package com.zcxy.sys.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.zcxy.mybatis.util.anotation.InverseJoinColumn;
import com.zcxy.mybatis.util.anotation.JoinColumn;
import com.zcxy.mybatis.util.anotation.JoinTable;
import com.zcxy.mybatis.util.anotation.ManyToMany;
import com.zcxy.sys.entity.SysRole;
import com.zcxy.sys.entity.SysRoleUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;


/**
 * 用户
 *
 * @author zcc
 * @email 860474958@qq.com
 * @date 2020-06-01
 */
@Data
@ApiModel(value = "SysUserVo", description = "用户实体对象")
public class SysUserVo {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键", required = false)
    private String id;

    @ApiModelProperty(value = "姓", required = false)
    private String surname;

    @ApiModelProperty(value = "名", required = false)
    private String name;

    @ApiModelProperty(value = "邮箱", required = false)
    private String email;

    @ApiModelProperty(value = "文件服务器", required = false)
    private String fileServer;

    @ApiModelProperty(value = "手机", required = false)
    private String telephone;

    @ApiModelProperty(value = "座机", required = false)
    private String fixedlineTelephone;

    @ApiModelProperty(value = "地址", required = false)
    private String address;

    @ApiModelProperty(value = "城市", required = false)
    private String city;

    @ApiModelProperty(value = "邮政编码", required = false)
    private String postalCode;

    @ApiModelProperty(value = "备注", required = false)
    private String remark;

    @ApiModelProperty(value = "用户状态", required = false)
    private String status;

    @ApiModelProperty(value = "(0非admin1是)", required = false)
    private String admin;

    @ApiModelProperty(value = "密码", required = false)
    private String password;

    @ApiModelProperty(value = "旧密码", required = false)
    @TableField(exist = false)
    private String oldpassword;

    @ApiModelProperty(value = "加密盐", required = false)
    private String salt;

    @ApiModelProperty(value = "全名", required = false)
    private String userName;

    @ApiModelProperty(value = "登录名", required = false)
    private String loginName;

    @ApiModelProperty(value = "全部工作区（0全部，1非全部）", required = false)
    private String allWorkspace;

    @ApiModelProperty(value = "对应业务的uuid", required = false)
    private String fileUuid;




    @ApiModelProperty(value = "所属角色", required = false)
    @ManyToMany(targetEntity = SysRole.class)
    @JoinTable(entityClass = SysRoleUser.class)
    @JoinColumn(name = "id", referencedColumnName = "user_id")
    @InverseJoinColumn(name = "role_id", referencedColumnName = "id")
    private List<SysRole> roles;


}
